class OpponentPlayer < Player
  
  def initialize(name, board, pool, prob_hash)
    super
  end
  
  def init_hand(n)
    @hand = Hand.new(n)
  end
  
  def draw(x)
    @hand.size += x
  end
  
  class Hand
    attr_accessor :size
    def initialize(n)
      @size = n
    end
    
    def remove(d)
      @size = @size - 1
    end  
    
    def size
      @size
    end
    
    def empty?
      @size == 0
    end
    
    def dominoes
      @pool.dominoes
    end
    
    def dup
      h = Hand.new @size
      h
    end
  
  end
  
  #Consider removing links to these objects and moving dependent functions to dominoes game functions module
  def dup(board, pool, prob_hash)
    p = OpponentPlayer.new @name.dup, board, pool, prob_hash
    h = @hand.dup
    p.send(:set_hand, h, @points)
    p
  end
  
  private
  
  def set_hand(h, p)
    @hand = h
    @points = p
  end
  
end